<?php
include("../conn.php");
include 't-cookie.php';
$teacher_id = $_SESSION["t-id"];
?>
<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>毕业设计</title>
    <link rel="stylesheet" type="text/css" href="../css/htmleaf-demo.css">
    <link rel="stylesheet" type="text/css" href="../css/nav.css">
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont.css">

    <link rel="stylesheet" href="../css/bootstrap-theme.css"/>

    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap-theme.min.css"/>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script type="text/javascript" src="../js/bootstrap3.0.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/style.css">


</head>

<body class="bodycolor">

<nav class="navbar navbar-default navbar-fixed-top" style="clear: left;">
    <div class="container">
        <div class="navbar-right navfont" id="navbar-collapse">
            <p>华软网络技术系毕业管理系统</p>
        </div>
        <a href="t-cookie.php?cookie=out" id="out">退出</a>
    </div>

</nav>

<div class="nav topx navbackground-t" id="nav">
    <div>

        <div style="border-bottom:1px solid rgba(255,255,255,.1)"><img src="../images/mini.png"></div>
    </div>
    <ul>
        <li class="nav-item">
            <a href="t-index.php"><i class="my-icon nav-icon icon_2"></i><span>首页</span><i class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="t-mykt.php"><i class="my-icon nav-icon icon_1"></i><span>我的课题</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="t-checkproject.php"><i class="my-icon nav-icon icon_6"></i><span>选课核查</span><i
                    class="my-icon nav-more"></i></a>
        </li>
        <li class="nav-item">
            <a href="#"><i class="my-icon nav-icon icon_3"></i><span>评分评语</span><i class="my-icon nav-more"></i></a>
            <ul>
                <li>
                    <a href="t-GuideMark.php"><span>指导评分</span></a>
                </li>
                <li>
                    <a href="t-ThesisMark.php"><span>论文评分</span></a>
                </li>
                <li>
                    <a href="t-ReplyMark.php"><span>答辩评分</span></a>
                </li>
            </ul>
        </li>
        <li class="nav-item">
            <a href="t-all.php"><i class="my-icon nav-icon icon_6"></i><span>答辩汇总</span><i
                    class="my-icon nav-more"></i></a>

        </li>
        <li class="nav-item">
            <a href="#"><i class="my-icon nav-icon icon_3"></i><span>资料管理</span><i class="my-icon nav-more"></i></a>
            <ul>
                <li>
                    <a href="t-information.php"><span>我的资料</span></a>
                </li>
                <li>
                    <a href="t-mystudent.php"><span>我的学生</span></a>
                </li>

            </ul>
        </li>
    </ul>
</div>

<!--查询语句-->
<!--从教师表链接到学生表，保证选择的学生都是该教师指导的学生，然后通过项目id链接项目表，在链接答辩评分表-->
<!--老师id $_SESSION["t-id"]-->
<?php
//$sql_all="SELECT ReplyMark. * , Project.ProjectName, teacher.TeacherName, student.StudentName, student.Tel
//		FROM ReplyMark
//		LEFT JOIN Project ON ReplyMark.Project_ProjectId = project.ProjectId
//		LEFT JOIN teacher ON ReplyMark.Teacher_TeacherId = teacher.TeacherId
//		LEFT JOIN student ON project.Student_StudentId = student.StudentId
//		order BY replymark.Project_ProjectId ";

$sql_main = "SELECT t.TeacherId,t.TeacherName,p.ProjectName,s.StudentId,s.StudentName,dz.Order8,dz.Order9,dz.Order10,dz.Order11,dz.remark from dzsubject as dz
  JOIN replymark as r on r.ReplyMarkId=dz.Project_ProjectId
  JOIN project as p on p.ProjectId = dz.Project_ProjectId
  JOIN teacher as t on t.TeacherId = p.Teacher_TeacherId
  JOIN student as s on s.StudentId = p.Student_StudentId
where r.Teacher_TeacherId=$teacher_id";



?>


<div class="indexborder">
    <center>
        <div class="indexdiv1 panel panel-default auto" align="center">
            <div class="panel " style="border:1px solid #8FBC8F"><!--panel-success-->
                <div class="panel-heading" style="background-color:#8FBC8F">
                    <h3 class="panel-title ">答辩汇总</h3>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>指导教师</th>
                                <th>答辩教师</th>
                                <th>课题名</th>
                                <th>学号</th>
                                <th>学生名</th>
                                <th>项8</th>
                                <th>项9</th>
                                <th>项10</th>
                                <th>项11</th>
                                <th>评语</th>
                            </tr>
                            </thead>
                            <?php $result_main = mysqli_query($conn, $sql_main);
                            while ($row_main = mysqli_fetch_array($result_main)) {
                                ?>
											<tr class="success">
											
												<td><?php echo $row_main[1]?></td>
												<td>---</td>
												<td><?php echo $row_main[2]?></td>
												<td><?php echo $row_main[3]?></td>
												<td><?php echo $row_main[4]?></td>
												<td><?php echo $row_main[5]?></td>
												<td><?php echo $row_main[6]?></td>
												<td><?php echo $row_main[7]?></td>
												<td><?php echo $row_main[8]?></td>
												<td><?php echo $row_main[9]?></td>
											</tr>
										
											<tr>
<?php
                                $student_id = $row_main[3];
                                $sql_all = "SELECT ReplyMark. * , Project.ProjectName, teacher.TeacherName, student.StudentName, student.StudentId
		FROM ReplyMark
		LEFT JOIN Project ON ReplyMark.Project_ProjectId = project.ProjectId
		LEFT JOIN teacher ON ReplyMark.Teacher_TeacherId = teacher.TeacherId
		LEFT JOIN student ON project.Student_StudentId = student.StudentId
		where student.StudentId=$student_id";
                                $result_all = mysqli_query($conn, $sql_all);
                                while ($row_all = mysqli_fetch_array($result_all)) {
                                    ?>
                                    <tr>
                                        <td>---</td>
                                        <td><?php echo $row_all['TeacherName']?></td>
                                        <td>---</td>
                                        <td>---</td>
                                        <td>---</td>
                                        <td><?php echo $row_all['Order8']?></td>
                                        <td><?php echo $row_all['Order9']?></td>
                                        <td><?php echo $row_all['Order10']?></td>
                                        <td><?php echo $row_all['Order11']?></td>
                                        <td><?php echo $row_all['remark']?></td>
                                    </tr>
                                <?php }?>
											</tr>
											<?php } ?>
                        </table>

                    </div>
                </div>
            </div>
        </div>
    </center>


</div>

<!--<footer class="indexfooter container-fluid  bottom">
    <p class="footer-p" align="center">地址：广东省广州市从化区经济开发区高技术产业园广从南路548号 | 电话：020－87818918 邮编：510990 | 网站公安备案编号：4401840100050 粤ICP备：05085382号 站长统计</p>
</footer>-->

<script>
    window.jQuery || document.write('<script src="../js/jquery-1.11.0.min.js"><\/script>')
</script>
<script type="text/javascript" src="../js/nav.js"></script>

</body>

</html>